import request from '@/utils/request'

import type { Response_Dto } from '@/Dto/Response/Api_Result'
import type { promises } from 'node:readline'


/**
 * 获取所有的套餐
 * @param obj 
 * @returns 
 */
export const Get_All_Package = (obj:{page:number,limit:number,key:string}): Promise<Response_Dto> => {
    return request({
        url:'api/product/Get_All_Package',
        method:'get',
        params:obj
    })
}
/**
 * 新增套餐
 * @param obj 
 * @returns 
 */
export const Add_Package = (obj:any): Promise<Response_Dto> => {
    return request({
        url:'api/product/Add_Package',
        method:'post',
        data:obj
    })

}
/**
 * 获取单个套餐详情
 * @param obj 
 * @returns 
 */
export const  Get_Package_Detail= (obj:{id:string}): Promise<Response_Dto> => {
    return request({
        url:'api/product/Get_Package_Detail',
        method:'get',
        params:obj
    })

}
/**
 * 上架下架套餐
 * @param obj 
 * @returns 
 */

export const isActive_Package = (obj:{id:string}): Promise<Response_Dto> => {
    return request({
        url:'api/product/isActive_Package',
        method:'post',
        data:obj
    })

}
/**
 *修改套餐
 */
export const Update_Package=(obj:{id:string,name:string,endtime:string,explain:string,stock:string,total_price:string,duration:number}):Promise<Response_Dto>=>{
    return request({
        url:'api/product/Update_Package',
        method:'post',
        data:obj
    })
};